/**
 * @author Tony
 * @date 2018-01-10
 * @project rest_demo
 */
package com.bcxk.common.smsutil;

import com.bcxk.common.smsutil.client.AbsRestClient;
import com.bcxk.common.smsutil.client.JsonReqClient;


public class RestAuthCode {
    private static final String SID="a01ba37b67e94ea14f29924297d8d223";
    private static final String TOKEN="d19b234d67599b422086eca189eae654";
    private static final String APPID="9030bca6a29e4e698306ee682013127d";


	static AbsRestClient InstantiationRestAPI() {
		return new JsonReqClient();
	}

    public  static void testSendSms( String param, String mobile){
		try {
			String result=InstantiationRestAPI().sendSms(SID, TOKEN, APPID, "499061", param, mobile,"");
			System.out.println("Response content is: " + result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

    private static void testSendSmsBatch(String sid, String token, String appid, String templateid, String param, String mobile, String uid){
		try {
			String result=InstantiationRestAPI().sendSmsBatch(sid, token, appid, templateid, param, mobile, uid);
			System.out.println("Response content is: " + result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

    private static void testAddSmsTemplate(String sid, String token, String appid, String type, String template_name, String autograph, String content){
		try {
			String result=InstantiationRestAPI().addSmsTemplate(sid, token, appid, type, template_name, autograph, content);
			System.out.println("Response content is: " + result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	 
	
	public static void testGetSmsTemplate(String sid, String token, String appid, String templateid, String page_num, String page_size){
		try {
			String result=InstantiationRestAPI().getSmsTemplate(sid, token, appid, templateid, page_num, page_size);
			System.out.println("Response content is: " + result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


    private static void testEditSmsTemplate(String sid, String token, String appid, String templateid, String type, String template_name, String autograph, String content){
		try {
			String result=InstantiationRestAPI().editSmsTemplate(sid, token, appid, templateid, type, template_name, autograph, content);
			System.out.println("Response content is: " + result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	private static void testDeleterSmsTemplate(String sid, String token, String appid, String templateid){
		try {
			String result=InstantiationRestAPI().deleterSmsTemplate(sid, token, appid, templateid);
			System.out.println("Response content is: " + result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	




}
